package com.wbao.dianniu.customView;

import android.content.Context;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

import com.wbao.dianniu.R;
import com.wbao.dianniu.data.SpanData;
import com.wbao.dianniu.utils.ActivityUtils;
import com.wbao.dianniu.utils.Utils;

/**
 * Created by Administrator on 2017/8/23.
 */

public class ClickSpan extends ClickableSpan {
    private Context context;
    private SpanData spanData;

    public ClickSpan(Context context, SpanData spanData) {
        this.context = context;
        this.spanData = spanData;
    }

    @Override
    public void onClick(View view) {
        /** 跳转 **/
        ActivityUtils.intoHeadInfoActivity(spanData.getAccountId(),context);
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        /** 给文字染色 **/
//        ds.setARGB(255, 96, 134, 174);
//        ds.setColor(context.getResources().getColor(R.color.blue_text));
        ds.setColor(context.getResources().getColor(R.color.pickerview_timebtn_nor));
        /** 去掉下划线 ， 默认自带下划线 **/
        ds.setUnderlineText(false);
    }
}
